<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="/WEB-INF/c.tld"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="admin/Hui/lib/html5.js"></script>
<script type="text/javascript" src="admin/Hui/lib/respond.min.js"></script>
<script type="text/javascript" src="admin/Hui/lib/PIE_IE678.js"></script>

<![endif]-->
<link type="text/css" rel="stylesheet" href="admin/Hui/css/H-ui.css" />
<link type="text/css" rel="stylesheet"
	href="admin/Hui/css/H-ui.admin.css" />
<link type="text/css" rel="stylesheet"
	href="admin/Hui/font/font-awesome.min.css" />
<!--[if IE 7]>
<link href="admin/Hui/font/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
<![endif]-->
<script type="text/javascript" src="admin/Hui/js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="admin/Hui/lib/layer1.9/layer.js"></script>
<title>修改部门</title>
<style>
hr {
	height: 1px;
	background-color: #F0F0F0;
}
#image img{
	height: 200px;
}
</style>

</head>
<body>
	<script>
		$(function() {
			$("#cid_name").on(
					"blur",
					function() {
						$.post("centerImageDes!checkDep.action", {
							cid_name : $("#cid_name").val(),
							cid_id : $("cid_id").val()
						}, function(data, status) {
							if (data == 0) {
								$("#insert").bind(
										"click",
										function(event) {
											if ($("#cid_name").val() != null
													&& $("#cid_name").val() != "") {
												layer.msg('该用户名已存在,请重新输入');
												return false;
											}
										});
								layer.msg('该用户名已存在,请重新输入');
							}
						});
					});
		});
	</script>
	<nav class="breadcrumb">
		<span><img src="admin/images/leftico01.png" /></span> 中心简介 <span
			class="c-gray en">&gt;</span> 部门管理 <span class="c-gray en">&gt;</span>增加部门
	</nav>
	<div class="pd-20">
		<div class="Huiform">
			<form action="centerImageDes!update.action" method="post" enctype="multipart/form-data">
				<input type="hidden" id="cid_id" name="cid_id" value="${cid_id }">
				<table class="table table-bg">
					<tbody>
						<tr>
							<th width="100" class="text-r"><span class="c-red">*</span>
								部门名称：</th>
							<td><input type="text" style="width: 500px"
								class="input-text" id="cid_name" name="cid_name" value="${cid_name }"
								datatype="*2-10" errormsg="部门名称范围在2-10位之间" nullmsg="部门名称不能为空">
						</tr>
						
						<tr>
							<th width="100" class="text-r"><span class="c-red"></span>
								部门图片：</th>
							<td><span class="btn-upload form-group">
	        						<input class="input-text upload-url" type="text" 
	        						name="" id="" readonly style="width:200px">
	        						<a href="javascript:void();" class="btn btn-primary radius upload-btn">
	        						 浏览文件</a>
	        						<input type="file" multiple name="upload" class="input-file">
        						</span>
        					</td>
						</tr>
						
						<tr>
							<th width="100" class="text-r"><span class="c-red"></span>
								</th>
							<td id="image">
								<img alt="" src="${cid_url }">
        					</td>
						</tr>

						<tr>
							<th class="text-r"><span class="c-red">*</span>部门描述：</th>
							<td><textarea name="cid_des" style="width: 700px" cols=""
									rows="" class="textarea" placeholder="角色描述...最少输入10个字符"
									datatype="*10-100" dragonfly="true" nullmsg="部门描述不能为空！"
									errormsg="描述范围在10-100位之间">${cid_des }</textarea></td>
						</tr>


						<tr>

							<th></th>
							<td><button class="btn btn-success radius" type="submit"
									id="insert">
									<i class="icon-ok"></i> 确定
								</button> <a href="javascript:history.go(-1);"
								class="btn btn-secondary radius" id="insert"> <i
									class="icon-ok"></i> 返回
							</a></td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
	</div>
	<%-- <script type="text/javascript" src="admin/Hui/lib/jquery.min.js"></script> --%>
	<script type="text/javascript" src="admin/Hui/lib/Validform_v5.3.2.js"></script>
	<script type="text/javascript" src="admin/Hui/js/H-ui.js"></script>
	<script type="text/javascript" src="admin/Hui/js/H-ui.admin.js"></script>
	<script type="text/javascript">
		$(".Huiform").Validform();
		$(function(){
			$("input[name=per_id]").click(
				function() {
					// 当选中或取消某个权限时，同时也选中或取消所有的下级权限
					$(this).siblings("ul").find("input").attr("checked",this.checked);
					// 当选中某个权限时，应同时选中他的直系上的权限。
					if (this.checked == true) { // 可以直接写为 if(this.checked){..}
						$(this).parents("li").children("input[name=per_id]").attr("checked", true);
					}
					// 当取消某个权限时，如果同级的权限都没有选择，就也取消上级权限
					else {
						if ($(this).parent().siblings("li").children("input:checked").size() == 0) {
							$(this).parent().parent().siblings("input").attr("checked", false);
						}
					}
				});
		});
	</script>

</body>
</html>